package appx.craft.asd.uc;

import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.inputmethod.InputMethodManager;
import android.widget.ImageView;
import appx.craft.asd.R;

public class TermsCondition_Dialog extends Dialog implements OnClickListener{
	
	/** The m context. */
	Context mContext;
	
	/** The m activity. */
	Activity mActivity;
	
	/** The btn_red_close. */
	ImageView btn_red_close;
	
	/** The m callback. */
	OnHeadNavigationSelectedListener mCallback;
	
	public TermsCondition_Dialog(Context context) {
		super(context,R.style.CustomDialog);
		this.mContext = context;
		mActivity = (Activity)context;
		mCallback = (OnHeadNavigationSelectedListener)context;
	}
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.popup_terms_condition);
		btn_red_close = (ImageView)findViewById(R.id.btn_red_close);
		btn_red_close.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {

		if(v.getId() == R.id.btn_red_close){
			if(isShowing()){
				hideKeyBoard(v);
				dismiss();
			}
		}
	}
	
	public void hideKeyBoard(View mView){
		InputMethodManager imm = (InputMethodManager)mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
		imm.hideSoftInputFromWindow(mView.getWindowToken(), 0);
		
	}


}
